package com.sjq.common.mq.config;
import java.util.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ConfigLoader {
	
	private static Logger logger = LoggerFactory.getLogger(ConfigLoader.class);

	private static final ConfigLoader instance = new ConfigLoader();
 
	private static final String CONFIG_FILE = "jmsmq.properties";
	
	//JMS 服务链接
	private String jmsBrokerUrl ;
	
	
	private String activemqJmxUsername;
	private String activemqJmxPassword;
	private String activemqJmxUrl;
	
	

	/** 初始化 */
	private ConfigLoader() {
		try{
			Properties prop = new Properties();
			prop.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(CONFIG_FILE));
			jmsBrokerUrl = (prop.getProperty("rmi.jms.broker.url"));
			logger.info(">>>>>>>>>>>>>>>>> jmsBrokerUrl:"+jmsBrokerUrl);
		}catch(Exception ex){
			ex.printStackTrace();
			throw new RuntimeException("ConfigLoader 配置异常：",ex);
		}
	}
	
	
	public static final ConfigLoader getInstance(){
		return instance;
	}
	

	public String getJmsBrokerUrl() {
		return jmsBrokerUrl;
	}


	public String getActivemqJmxUsername() {
		return activemqJmxUsername;
	}


	public void setActivemqJmxUsername(String activemqJmxUsername) {
		this.activemqJmxUsername = activemqJmxUsername;
	}


	public String getActivemqJmxPassword() {
		return activemqJmxPassword;
	}


	public void setActivemqJmxPassword(String activemqJmxPassword) {
		this.activemqJmxPassword = activemqJmxPassword;
	}


	public String getActivemqJmxUrl() {
		return activemqJmxUrl;
	}


	public void setActivemqJmxUrl(String activemqJmxUrl) {
		this.activemqJmxUrl = activemqJmxUrl;
	}

	 

}
